package demo;

public class ThisDemo {

	private int age;
	private String name;
	ThisDemo() {
		System.out.println("无参数构造");
	}
	ThisDemo(int age,String name){
		//this();
		this.name=name;
		this.age=age;
		System.out.println("有参数构造");
	}
	public void say(){
		System.out.println("我叫："+name+",今年："+age+"岁了！");
	}
	
	public static void main(String[] args) {
		//ThisDemo thisDemo = new ThisDemo();
		ThisDemo thisDemo2 = new ThisDemo(21, "张三");
//		thisDemo.name="jackie";
//		thisDemo.age=21;
		thisDemo2.say();
	}
	
}
